<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关键字</title>
</head>
<body>
    <!-- 关键字 -->
    <!-- continue -->
    <!-- 退出本次循环 -->
    <script>
    for (var i = 1; i <= 5; i++ ){
        if(i == 3){
            continue;  //只要遇到continue就退出本次循环，直接跳到i++

        }
        console.log('我正在吃第'+i+'包子');
    }
    </script>

    <script>
        // 求 1-100之间 除了能被7整除之外的整数和
        var sum = 0;
        for ( var i = 1; i <= 100; i++){
            if(i % 7 == 0){
                continue;
            }
            sum += i;
        }
        console.log(sum);
    </script>



        <!-- 关键字 -->
        <!-- break -->
        <!-- 退出整个循环 -->
        <script>
            for (var j = 1; j <= 5; j++){
                if (j == 3 ){
                    break;
                }
                console.log(j);
            }
        </script>

</body>
</html>